﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tapt.Data.DataModel;

namespace Tapt.Data.Services
{
    public static class GeneralDataService
    {
        public static Tapt.Data.DataModel.GeneralData Get(string key) 
        {
            using(TaptDataEntities db = new TaptDataEntities())
            {
                string dir = AppDomain.CurrentDomain.GetData("DataDirectory").ToString();
             return db.GeneralDatas.Where(item => item.Key == key).FirstOrDefault();
            }
        }

        public static List<Tapt.Data.DataModel.GeneralData> GetAll()
        {
            Tapt.Data.DataModel.TaptDataEntities db = new DataModel.TaptDataEntities();
            return db.GeneralDatas.ToList();
        }
    }
}
